package com;

public class FileNameUtil {

    public static String subSuffix(String name){
        return name.substring(0,name.indexOf("."));
    }

    public static String toPathByPackage(String packageName){
        return packageName.replace(".","/");
    }

    public static String getClassNamebySmallClassName(String className){
        return  new StringBuffer(className.substring(0,1).toUpperCase()).append(className.substring(1)).toString();
    }

    public static String toClassByTable(String tableName){
        if(tableName.startsWith("t_")){
            tableName = tableName.substring(2);
        }
        return  getClassNamebySmallClassName(tableName);
    }

    public static String toSmallClassName(String className){
        return new StringBuffer(className.substring(0, 1).toLowerCase()).append(className.substring(1)).toString();
    }
}
